﻿<my:PhoneUIElement x:Class="PhoneModules.Controls.PhoneUIElementButton"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:my="clr-namespace:PhoneModules.Controls"
             mc:Ignorable="d" Loaded="PhoneUIElement_Loaded" MouseMove="canvas1_PreviewMouseMove" MouseUp="canvas1_PreviewMouseUp" MouseDown="PhoneUIElement_PreviewMouseDown" >
    <StackPanel Orientation="Horizontal" Name="stackPanel1">
        <StackPanel.Triggers>
            <EventTrigger RoutedEvent="Border.MouseEnter">
                <BeginStoryboard>
                    <Storyboard>
                        <DoubleAnimation 
						            Storyboard.TargetName="gridEdit"
						            Storyboard.TargetProperty="Opacity"
						            To="1.0" Duration="0:0:0.2" />
                        <!--<ThicknessAnimation
                                    Storyboard.TargetName="textBlock1"
                                    Storyboard.TargetProperty="BorderThickness"
                                    To="1" Duration="0:0:0.2" />-->
                    </Storyboard>
                </BeginStoryboard>
            </EventTrigger>
            <EventTrigger RoutedEvent="Border.MouseLeave">
                <BeginStoryboard>
                    <Storyboard>
                        <DoubleAnimation 
						            Storyboard.TargetName="gridEdit"
						            Storyboard.TargetProperty="Opacity"
						            To="0.0" Duration="0:0:0.2" />
                        <!--<ThicknessAnimation
                                    Storyboard.TargetName="textBlock1"
                                    Storyboard.TargetProperty="BorderThickness"
                                    To="0" Duration="0:0:0.2" />-->
                    </Storyboard>
                </BeginStoryboard>
            </EventTrigger>
        </StackPanel.Triggers>
        <Border Name="borderSelected" BorderThickness="2" Padding="2,2,2,2">
            <Border.Resources>
                <Storyboard x:Key="storyboardSelected">
                    <DoubleAnimation
                    Storyboard.TargetName="borderBrush"
                    Storyboard.TargetProperty="Opacity"
                    From="0.15"
                    To="0.8"
                    Duration="0:0:2" RepeatBehavior="Forever" AutoReverse="True" />
                </Storyboard>
            </Border.Resources>
            <Border.Background>
                <SolidColorBrush>
                    <SolidColorBrush.Color>
                        <Color R="0" G="0" B="0" A="1" />
                    </SolidColorBrush.Color>
                </SolidColorBrush>
            </Border.Background>
            <Border.BorderBrush>
                <SolidColorBrush x:Name="borderBrush" Color="White" Opacity="0" />
            </Border.BorderBrush>
            <Grid>
                <Border Name="border1" Width="100" Height="50" CornerRadius="15" BorderBrush="Gray" BorderThickness="1" Background="White" >
                    <!--<Rectangle Height="37" HorizontalAlignment="Left" Margin="333,24,0,0" Name="rectangle1" Stroke="Gray" VerticalAlignment="Top" Width="115" RadiusX="15" RadiusY="15" />-->
                    <!--<TextBlock Height="15" HorizontalAlignment="Left" Name="textBlock1" Text="Button" VerticalAlignment="Center" FontFamily="Arial" FontSize="14" FontWeight="Bold" Width="101" TextAlignment="Center" />-->
                    <TextBox Height="23" HorizontalAlignment="Center" Name="textBox1" Text="Button" VerticalAlignment="Center" FontFamily="Arial" FontSize="14" FontWeight="Bold" BorderThickness="0" VerticalContentAlignment="Center" IsHitTestVisible="False" PreviewTextInput="textBox1_PreviewTextInput" TextChanged="textBox1_TextChanged" />
                    <!--<Image Name="imageEdit" Source="/PhoneModules;component/knewstuff-32.png" Margin="81,0,6,23" Opacity="0" />-->
                </Border>
                <Image Name="image1" Width="50" Height="30" Visibility="Hidden" />
            </Grid>
        </Border>
        <Grid Name="gridEdit" Margin="0,0,0,0" Opacity="0">
            <Button Name="buttonText" Height="22" Margin="5,0,5,26" Click="buttonText_Click">Text</Button>
            <Button Name="buttonImage" Margin="5,25,5,5" Height="22" Click="buttonImage_Click">Image</Button>
        </Grid>
    </StackPanel>
</my:PhoneUIElement>
